home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / util / text / chktex.rea < prev    next >
Text File  |  1995-08-03  |  8KB  |  198 lines

  1. Short:    Finds common errors in (La)TeX files
  2. Author:   <jensthi@ifi.uio.no> (Jens T. Berger Thielemann)
  3. Uploader: <jensthi@ifi.uio.no> (Jens T. Berger Thielemann)
  4. Type:     text/tex
  5.  
  6.              #####  ###       ###    ########     ###     ##
  7.            ###   ##  ##        ##       ##          ##   #
  8.           @@         @@ @@@    @@  @@   @@  #######  @@ @
  9.           @@         @@@  @@   @@ @@    @@   ##   #   @@
  10.           &&         &&   &&   &&&&     &&   @@      & &&
  11.            &&&   &&  &&   &&   && &&    &&   @@@@   &   &&
  12.              %%%%%  %%%   %%% %%%  %%%  %%   &&   %%%    %%% v1.0
  13.                                              &&   &
  14.                                             %%%%%%%
  15.                              ChkTeX v1.0
  16.                              ~~~~~~~~~~~
  17. This  program  was  written  in frustration of that some constructs in
  18. LaTeX are sometimes non-intuitive, and easy to forget.  It was written
  19. in  ANSI  C,  so  you  could use this at your UNIX/MSDOS/whatever site
  20. also.  Full source included.
  21.  
  22. In  the  Amiga  version,  however,  the  program  is  localized.   The
  23. localization was created by using C2LOCAL, the automatically generated
  24. source  code  is  not  included.  A catalog for Norwegian is included,
  25. plus a skeleton for further translation.
  26.  
  27. The  program  itself  does not have any machine requirements, an Amiga
  28. compiled  version is included which should work on all Amigas.  You'll
  29. get translations only on 2.1+, though.
  30.  
  31.                              Legal stuff
  32.                              ~~~~~~~~~~~
  33. ChkTeX,  its  documentation and its installation scripts are copyright
  34. (C) 1995 Jens T. Berger Thielemann.
  35.  
  36. This  program  is free software; you can redistribute it and/or modify
  37. it  under  the terms of the GNU General Public License as published by
  38. the  Free Software Foundation; either version 2 of the License, or (at
  39. your option) any later version.
  40.  
  41. This  program  is  distributed in the hope that it will be useful, but
  42. WITHOUT   ANY   WARRANTY;   without   even  the  implied  warranty  of
  43. MERCHANTABILITY  or  FITNESS  FOR  A  PARTICULAR PURPOSE.  See the GNU
  44. General Public License for more details.
  45.  
  46. You  should  have  received  a  copy of the GNU General Public License
  47. along   with  this  program;  if  not,  write  to  the  Free  Software
  48. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  49.  
  50.                          Errors searched for
  51.                          ~~~~~~~~~~~~~~~~~~~
  52. Currently,  it  will  catch  the  following  errors,  the  error being
  53. underlined:
  54.  
  55. ----------------------------------------------------------------------
  56.  
  57.   \LaTeX is a typesetting package.
  58.         ^
  59. Most probably, you would like this to look like this:
  60.  
  61.   \LaTeX\ is a typesetting package.
  62.  
  63. An  environment  file  tells ChkTeX which commands that may end with a
  64. normal  space,  like  `\bf'  or  similar, which don't produce any text
  65. output.  In math mode, this checking is of course turned off.
  66.  
  67. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  68.   Please refer to figure \ref{foo}.
  69.                         ^
  70. This should rather look like this:
  71.  
  72.   Please refer to figure~\ref{foo}.
  73.  
  74. An  environment  file  tells  ChkTeX  which  commands  that  should be
  75. prefaced with a non-breaking space.
  76.  
  77. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  78.   This is an example of use of accents: \'{i}.
  79.  
  80. This will not look pretty.  It should rather be:
  81.  
  82.   This is an example of use of accents: \'{\i}.
  83.  
  84. It  does also try to differ between whether we're in math mode or not.
  85. It  is possible to customize which functions which needs the use of \i
  86. or \j.
  87.  
  88. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  89.   This is an example, i.e. an demonstration.
  90.                           ^
  91. This will cause incorrect spacing, and should be written as:
  92.  
  93.   This is an example, i.e.\ an demonstration.
  94.  
  95. The  abbrevs  which  you wish to search for, are of course kept in the
  96. very same env-file.
  97.  
  98. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  99.   I've seen an UFO! Right over there!
  100.                    ^
  101. Will once more cause incorrect spacing, it should read:
  102.  
  103.   I've seen an UFO\@! Right over there!
  104.  
  105. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106.   I don't know quite...I think it's wrong.
  107.  
  108. This ellipsis will not look good.  You should rather write:
  109.  
  110.   I don't know quite\ldots I think it's wrong.
  111.  
  112. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  113.   It wasn't anything - just a 2---3 star--shots, or something else.
  114.                      ^         ^^^      ^^
  115. In  all  cases,  an  incorrect dash-length was used, it should be like
  116. this:
  117.  
  118.   It wasn't anything --- just a 2--3 star-shots, or something else.
  119.  
  120. This  check  is  rather  vague, as it will only check the character in
  121. front of the dashes.  It uses the following table:
  122.  
  123.     o If the dashes are leaded by a space, there should be three `-'s.
  124.     o If the dashes are leaded by a digit, there should be two `-'s.
  125.     o If the dashes are leaded by a character, there should be one `-'.
  126.  
  127. This  is  more or less correct, according to my references.  Hopefully
  128. this check can be improved (suggestions?).
  129.  
  130. ----------------------------------------------------------------------
  131.  
  132. Wherever  `a space' is mentioned, we'll of course also detect tabs and
  133. other spacing characters recognized by isspace().
  134.  
  135. In addition, it will keep track of brackets characters (`{}[]()'), and
  136. make  sure  that  they  match.   Everything  found is of course pumped
  137. nicely to stdout, with line number and error position.
  138.  
  139. To  get  a quick demonstration of ChkTeX' features, run it on the file
  140. `Test.tex'.   Although  most  of  the  file  is nonsense in a TeXnical
  141. manner  (lots  of  pseudo-commands),  it  will show what ChkTeX has to
  142. offer.
  143.  
  144.                        Porting and translation.
  145.                        ~~~~~~~~~~~~~~~~~~~~~~~~
  146. Porting  should  be  rather easy.  However, to ensure that the porting
  147. proceeds  painless,  read the first lines of the `ChkTeX.h' file.  Not
  148. very much to do, and it will make life easier later.
  149.  
  150. If you wish to translate the strings used in the programs (should only
  151. need  5  minutes of work), look in the Catalogs directory.  Write your
  152. translations  in  the  file ChkTeX_locale.ct, and mail it to me.  I'll
  153. include it in the next release.  In advance, thanks for your support.
  154.  
  155.                                 Usage
  156.                                 ~~~~~
  157. Easy-peasy:
  158.  
  159. ChkTeX <TeX-file>
  160.  
  161. No  options  -  currently.   You  should,  however, take a look at the
  162. `.chktexrc'  file.   It  is  located  in `ENV:' and `ENVARC:' on 2.04+
  163. Amiga's,  in  `S:'  on  1.3  Amiga's,  in your $HOME directory on UNIX
  164. boxes.   This  depends  also upon what you did to the `ChkTeX.h' file.
  165. It  should  be  rather self-explanatory, and should help you customize
  166. the program to your own needs.
  167.  
  168.                                  Bugs
  169.                                  ~~~~
  170. No  fatal  ones,  I think, but the program currently has some problems
  171. when  a command/parameter stretch over a two lines.  Also, the killing
  172. of comments is still at bit brutal (but correct :-) ).
  173.  
  174. The  detection of whether we're in math mode is also not perfect.  The
  175. only  codes  which are recognized for getting in/out of math mode are:
  176. `$',   `$$',   `\(',   `\)',   `\['   and   `\]'.   Environments  like
  177. \begin{displaymath},  user-defined  commands,  etc., do thus not work.
  178. This  is  usually  no  problem, as it just creates a bit more warnings
  179. than needed.
  180.  
  181.  
  182.  
  183.                         Contacting the author
  184.                         ~~~~~~~~~~~~~~~~~~~~~
  185. If  you  wish  to  contact  me  for whatever (more tests, bug reports,
  186. suggestions, hellos, smiley's, etc.), write to:
  187.  
  188.   Jens Berger
  189.   Spektrumvn. 4
  190.   N-0666 Oslo
  191.   Norway
  192.  
  193.   E-mail: <jensthi@ifi.uio.no>
  194.  
  195. Any signs of intelligent life is welcomed; that should exclude piracy.
  196.  
  197. Have fun.
  198.